Object cleanup (#307)
* elminiate some early program exits.
exits without cleanup make it harder to find memory leaks.
fix a few leaks.
enhance random format to support reading real time position data.
correct some sign related warnings.
* use invariant generator for random format.
* make compilers happy with random.
clang doesn't like:
random.cc:61:42: note: read of non-constexpr variable 'generator' is not allowed in a constant expression
constexpr double scalefactor = 1.0 / (*generator).max();
msvc doesn't like:
warning C4100: 'fname': unreferenced formal parameter
* catch main.cc up with master manually.
12 files changed: